/*
 Navicat Premium Data Transfer

 Source Server         : localhost
 Source Server Type    : MySQL
 Source Server Version : 50724
 Source Host           : localhost:3306
 Source Schema         : rz_admin

 Target Server Type    : MySQL
 Target Server Version : 50724
 File Encoding         : 65001

 Date: 04/03/2019 09:07:52
*/

SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;

-- ----------------------------
-- Table structure for t_admin
-- ----------------------------
DROP TABLE IF EXISTS `t_admin`;
CREATE TABLE `t_admin` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `username` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `password` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `rdm_salt` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `remark` varchar(150) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `phone` varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `crte_time` datetime DEFAULT NULL,
  `crte_admin_id` int(11) DEFAULT NULL,
  `editabled` tinyint(1) DEFAULT '1',
  `email` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sex` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `org_id` int(11) DEFAULT NULL COMMENT '所属企业或者公司ID',
  `group_id` int(11) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='管理员表';

-- ----------------------------
-- Records of t_admin
-- ----------------------------
BEGIN;
INSERT INTO `t_admin` VALUES (1, 'admin', 'e8e25f0a697c09969ea4fc12b1d339a3', '6963', '系统root账户', '13912865977', '2019-01-04 16:52:41', 1, 0, NULL, '0', 0, 6);
COMMIT;

-- ----------------------------
-- Table structure for t_admin_role
-- ----------------------------
DROP TABLE IF EXISTS `t_admin_role`;
CREATE TABLE `t_admin_role` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `admin_id` int(11) NOT NULL,
  `role_id` int(11) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='管理员角色关系表';

-- ----------------------------
-- Records of t_admin_role
-- ----------------------------
BEGIN;
INSERT INTO `t_admin_role` VALUES (1, 1, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_group
-- ----------------------------
DROP TABLE IF EXISTS `t_group`;
CREATE TABLE `t_group` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int(11) DEFAULT NULL,
  `crte_time` datetime DEFAULT NULL,
  `crte_admin_id` int(11) DEFAULT NULL,
  `org_id` int(11) DEFAULT NULL COMMENT '所属公司或企业ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='管理员分组表';

-- ----------------------------
-- Records of t_group
-- ----------------------------
BEGIN;
INSERT INTO `t_group` VALUES (1, '销售组', 0, '2019-02-13 10:35:20', 1, 0);
INSERT INTO `t_group` VALUES (2, '华东地区', 1, '2019-02-13 10:35:58', 1, 0);
INSERT INTO `t_group` VALUES (3, '华北地区', 1, '2019-02-13 10:36:19', 1, 0);
INSERT INTO `t_group` VALUES (5, '华北1', 3, NULL, 1, 0);
INSERT INTO `t_group` VALUES (6, '华东1', 2, '2019-02-14 11:27:40', 1, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_group_resource
-- ----------------------------
DROP TABLE IF EXISTS `t_group_resource`;
CREATE TABLE `t_group_resource` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `group_id` int(11) NOT NULL,
  `res_id` int(11) NOT NULL,
  `leaf` int(2) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='管理员分组资源关系表';

-- ----------------------------
-- Records of t_group_resource
-- ----------------------------
BEGIN;
INSERT INTO `t_group_resource` VALUES (1, 6, 11, 1);
INSERT INTO `t_group_resource` VALUES (2, 6, 8, 1);
INSERT INTO `t_group_resource` VALUES (3, 6, 3, 1);
INSERT INTO `t_group_resource` VALUES (4, 6, 1, 0);
INSERT INTO `t_group_resource` VALUES (5, 6, 12, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_org
-- ----------------------------
DROP TABLE IF EXISTS `t_org`;
CREATE TABLE `t_org` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `org_name` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `crte_time` datetime DEFAULT NULL,
  `tryout` tinyint(2) DEFAULT NULL COMMENT '0.试用；1.正式',
  `allow_account_num` int(6) DEFAULT NULL COMMENT '允许注册的账号数',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;

-- ----------------------------
-- Table structure for t_resource
-- ----------------------------
DROP TABLE IF EXISTS `t_resource`;
CREATE TABLE `t_resource` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL,
  `code` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL,
  `res_path` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `parent_id` int(11) NOT NULL,
  `type` int(2) NOT NULL COMMENT '1.模块；2.菜单；3.按钮；4.其他元素',
  `icon` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `sort_by` int(6) unsigned NOT NULL DEFAULT '0',
  `level` int(6) DEFAULT NULL,
  `leaf` tinyint(2) DEFAULT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='资源表';

-- ----------------------------
-- Records of t_resource
-- ----------------------------
BEGIN;
INSERT INTO `t_resource` VALUES (1, '资源配置', 'res_config', '', 0, 0, 'folder', 0, 1, 0);
INSERT INTO `t_resource` VALUES (2, '系统设置', 'Setting', NULL, 1, 1, 'cog', 2, 2, 0);
INSERT INTO `t_resource` VALUES (3, '资源管理', 'Resource', 'system/Resource', 2, 2, 'bars', 1, 3, 1);
INSERT INTO `t_resource` VALUES (4, '用户管理', 'AdminMng', 'system/AdminMng', 2, 2, 'user', 2, 3, 1);
INSERT INTO `t_resource` VALUES (8, '供应商管理', 'AddressBook', 'baseinfo/AddressBook', 11, 2, 'address-book', 1, 3, 1);
INSERT INTO `t_resource` VALUES (9, '角色管理', 'RoleMng', 'system/RoleMng', 2, 2, 'user-circle', 2, 3, 1);
INSERT INTO `t_resource` VALUES (12, '全局设置', 'GlobalSetting', NULL, 1, 1, 'globe', 1, 2, 0);
INSERT INTO `t_resource` VALUES (13, '大厅摄像头配置', 'HallCamera', 'gamble/global/HallCamera', 12, 2, 'camera', 1, 3, 1);
INSERT INTO `t_resource` VALUES (14, '台桌管理', 'DesktopMng', 'gamble/DesktopMng', 1, 2, 'dashboard', 1, 2, 0);
INSERT INTO `t_resource` VALUES (15, '台桌列表', 'PlayDesktop', 'gamble/PlayDesktop', 14, 2, 'list-alt', 1, 3, 1);
INSERT INTO `t_resource` VALUES (16, '台桌结果', 'PlayResult', 'gamble/PlayResult', 14, 2, 'search', 1, 3, 1);
COMMIT;

-- ----------------------------
-- Table structure for t_role
-- ----------------------------
DROP TABLE IF EXISTS `t_role`;
CREATE TABLE `t_role` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `role_name` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `crte_admin_id` int(11) DEFAULT NULL,
  `remark` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
  `crte_time` datetime DEFAULT NULL,
  `editabled` tinyint(1) DEFAULT '1',
  `org_id` int(11) DEFAULT NULL COMMENT '所属公司或企业ID',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色表';

-- ----------------------------
-- Records of t_role
-- ----------------------------
BEGIN;
INSERT INTO `t_role` VALUES (1, '超级管理员', 1, 'root角色', '2019-01-04 16:48:10', 0, 0);
COMMIT;

-- ----------------------------
-- Table structure for t_role_resource
-- ----------------------------
DROP TABLE IF EXISTS `t_role_resource`;
CREATE TABLE `t_role_resource` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `role_id` int(11) NOT NULL,
  `res_id` int(11) NOT NULL,
  `leaf` int(1) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=72 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='角色资源表';

-- ----------------------------
-- Records of t_role_resource
-- ----------------------------
BEGIN;
INSERT INTO `t_role_resource` VALUES (1, 1, 1, 0);
INSERT INTO `t_role_resource` VALUES (2, 1, 2, 1);
INSERT INTO `t_role_resource` VALUES (3, 1, 3, 1);
INSERT INTO `t_role_resource` VALUES (4, 1, 4, 1);
INSERT INTO `t_role_resource` VALUES (5, 1, 7, 1);
INSERT INTO `t_role_resource` VALUES (45, 1, 9, 0);
INSERT INTO `t_role_resource` VALUES (61, 1, 10, 0);
INSERT INTO `t_role_resource` VALUES (62, 1, 11, 0);
INSERT INTO `t_role_resource` VALUES (67, 1, 12, 0);
INSERT INTO `t_role_resource` VALUES (68, 1, 13, 0);
INSERT INTO `t_role_resource` VALUES (69, 1, 14, 0);
INSERT INTO `t_role_resource` VALUES (70, 1, 15, 0);
INSERT INTO `t_role_resource` VALUES (71, 1, 16, 0);
COMMIT;

SET FOREIGN_KEY_CHECKS = 1;
